/*
 * SR.java
 *
 * Created on 19.03.2006, 15:06
 *
 * Copyright (c) 2005-2008, Eugene Stahov (evgs), http://bombus-im.org
 *
 * This program is free software; you can redistribute it and/or
 * modify it under the terms of the GNU General Public License
 * as published by the Free Software Foundation; either version 2
 * of the License, or (at your option) any later version.
 *
 * You can also redistribute and/or modify this program under the
 * terms of the Psi License, specified in the accompanied COPYING
 * file, as published by the Psi Project; either dated January 1st,
 * 2005, or (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this library; if not, write to the Free Software
 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
 */

package locale;

import java.util.Hashtable;
import util.StringLoader;

public class SR {

    private static Hashtable lang;

    public   static String MS_MENU=loadString("Menu");
    public   static String MS_BACK = loadString( "Back" );
    public   static String MS_MOVE_UP = loadString( "Move Up" );
    public   static String MS_OK = loadString( "Ok" );
    public   static String MS_DONE = loadString( "Done" );
    public   static String MS_BROWSE = loadString( "Browse" );
    public   static String MS_SELECT = loadString( "Select" );
    public   static String MS_APP_QUIT = loadString( "Quit" );
    public   static String MS_ROOT = loadString( "Root" );
    public   static String MS_DELETE = loadString( "Delete" );
    public   static String MS_CANCEL = loadString( "Cancel" );
    public   static String MS_EDIT = loadString( "Edit" );
    
    private SR() { }
    
    private static String loadString(String key) {
        /*if (lang==null) {
            String langFile="/lang/ru.txt";
            if (langFile==null)*/
                lang=new Hashtable(); 
            /*else
                lang=new StringLoader().hashtableLoader(langFile);
        }*/
        String value=(String)lang.get(key);
//#if LOCALE_DEBUG
//#         if (value==null) {
//#             if (!lang.isEmpty()) {
//#                 System.out.print("Can't find local string for <");
//#                 System.out.println(key);
//#                 System.out.println('>');
//#             }
//#         }
//#endif
        return (value==null)?key:value;
    }

    public static void loaded() {
        lang=null;
    }
}
